home *** CD-ROM | disk | FTP | other *** search
- unit Bit3;
-
- interface
-
- {$R BITS.RES}
-
- uses
- SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
- Forms, Dialogs, ExtCtrls;
-
- type
- TForm1 = class(TForm)
- Image1: TImage;
- Timer1: TTimer;
- procedure FormCreate(Sender: TObject);
- procedure Timer1Timer(Sender: TObject);
- procedure FormDestroy(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- MyBitmap:array [0..1] of TBitmap;
- BitMapNum:integer;
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- {$R *.DFM}
-
- procedure TForm1.FormCreate(Sender: TObject);
- begin
- MyBitmap[0]:=TBitmap.Create;
- MyBitmap[1]:=TBitmap.Create;
- MyBitmap[0].Handle := LoadBitmap(hInstance,'FIRST');
- MyBitmap[1].Handle := LoadBitmap(hInstance,'SECOND');
- Image1.Width:=MyBitmap[0].Width;
- Image1.Height:=MyBitmap[0].Height;
- { Show the image component copy of the bitmap }
- Image1.Canvas.Draw(0,0,MyBitmap[0]);
- BitMapNum:=0;
- Timer1.Interval:=200;
- end;
-
- procedure TForm1.Timer1Timer(Sender: TObject);
- begin
- BitMapNum:= (BitMapNum + 1) MOD 2;
- Image1.Canvas.Draw(0,0,MyBitmap[BitMapNum]);
- end;
-
- procedure TForm1.FormDestroy(Sender: TObject);
- begin
- MyBitmap[0].Destroy;
- MyBitmap[1].Destroy;
- end;
-
- end.
-